package com.greentreecs.fms.service;

import com.greentreecs.fms.exception.BadParamException;
import com.greentreecs.fms.pojo.dto.IncDetailRecDTO;
import com.greentreecs.fms.pojo.param.CreateIncDetailParam;
import com.greentreecs.fms.pojo.param.QueryIncDetailParam;
import com.greentreecs.fms.pojo.param.UpdateIncDetailParam;
import org.springframework.dao.DataAccessException;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 刀氏春秋
 * @date 2025/2/18
 */
public interface IncomeAnalyseService {
    /**
     * 创建新收入明细
     *
     * @param param 收入明细参数对象
     */
    void createNewIncomeDetail(CreateIncDetailParam param) throws SQLException, BadParamException;

    /**
     * 查询收入明细
     *
     * @param param 明细查询参数
     */
    List<IncDetailRecDTO> queryIncomeDetail(QueryIncDetailParam param) throws SQLException;

    /**
     * 删除指定收入明细
     *
     * @param params 明细id列表
     * @return 删除的数据量
     * @throws SQLException sql异常
     */
    Integer deleteIncomeDetail(List<Integer> params) throws SQLException;

    /**
     * 更新指定收入明细
     *
     * @param param 明细更新参数
     * @return 更新的记录数量（为0意味着更新失败）
     * @throws SQLException sql异常
     */
    Integer updateIncomeDetail(UpdateIncDetailParam param) throws SQLException;
}
